﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2023_09_13
{
    internal class BigNumberMul
    {
        static void Main1(string[] args)
        {
            List<string> list = new List<string>();
            int len = 0;
            while (true)
            {
                string input = Console.ReadLine();
                if (input.Equals(" ") == false)
                    list.Insert(len++, input);
                else
                    break;
            }
            for (int i = 0; i < len; i++)
            {
                string[] nums = list[i].Split();
                Console.WriteLine(IntegerMultiply(int.Parse(nums[0]), int.Parse(nums[1]), nums[0].Length));
            }
        }

        private static int Symbol(int N)
        {
            return N > 0 ? 1 : -1;
        }

        public static int IntegerMultiply(int num1, int num2, int bits)
        {
            int flag = Symbol(num1) * Symbol(num2);
            int x = Math.Abs(num1);
            int y = Math.Abs(num2);
            if ((0 == x) || (0 == y))
                return 0;
            if (1 == bits)
            {
                return flag * x * y;
            }
            else
            {
                int num1L = x / (int)Math.Pow(10, (int)bits / 2);
                int num1R = x - num1L * (int)Math.Pow(10, bits / 2);
                int num2L = y / (int)Math.Pow(10, (int)bits / 2);
                int num2R = y - num2L * (int)Math.Pow(10, bits / 2);

                int num1Lnum2L = IntegerMultiply(num1L, num2L, bits / 2);
                int num1Rnum2R = IntegerMultiply(num1R, num2R, bits / 2);
                int num1Lnum2Rnum1Rnum2L = IntegerMultiply(num1L - num1R, num2R - num2L, bits / 2) + num1Lnum2L + num1Rnum2R;
                return (num1Lnum2L * (int)Math.Pow(10, bits) + num1Lnum2Rnum1Rnum2L * (int)Math.Pow(10, bits / 2) + num1Rnum2R);
            }
        }
    }
}
